#include "../include/mytest.h"
#include "../include/mystring.h"

const int test_time = 10;

int main(void)
{
    RAND_INIT
    char buf1[64];
    char buf2[64];
    for(int i = 0; i < test_time; i++)
    {
        int n = RAND(0,30);
        generate_one_string(buf1);
        generate_one_string(buf2);

        // fprintf(stdout, "buf1 = %s\n", buf1);
        // fprintf(stdout, "buf2 = %s\n", buf2);

        if(strcmp(buf1, buf2) != _strcmp(buf1, buf2))
        {
            fprintf(stderr, "buf1 = %s while buf2 = %s", buf1, buf2);
            fprintf(stderr, T_R("FAIL!\n"));
            assert(0);
        }
        if(strncmp(buf1, buf2, n) != _strncmp(buf1, buf2, n))
        {
            fprintf(stderr, "buf1 = %s while buf2 = %s", buf1, buf2);
            fprintf(stderr, T_R("FAIL!\n"));
            assert(0);
        }
    }
    printf(T_G("ALL PASS!\n"));
    return 0;
}
